blocklandworldfandomcom-20200214-history
Increment print
Wait! Explain these things to me first! What DO they do? IncrementPrintCount This will increase the number your print is at depending on the number you give it. DecrementPrintCount This will decrease the number of your print by one instead! OnprintCountOverflow / OnprintCountUnderflow This is called when the number gets to 9. You can also use OnprintCountUnderflow for when it goes under 0. You can also use overflows to control other events, Such as overflow activating another set of events, Because the built in delay system has a maximum of 30 seconds, You could technically delay events for as long as you wanted using prints. Increment print and you! Timers, Countdowns, Cookers, Explosions, Turkey basters, They all need counters (apart from the last one maybe) And luckily they're extremely easy to do. So lets do it then. First up let's make a button and two (Or more if you're feeling frisky) print blocks. Now that they're comfortably sitting there we need to name them, So let's name them something simple like "SecondNumber" and "FirstNumber" SecondNumber being the second digit and so on. Now let's pay attention to the big shiny button, And get to eventing it. Like i said, It's easy, So all we need is 0 OnActivate => => IncrementPrintCount 1 (SecondNumber) Now for even more easy events, We need to hop over to the second digit (SecondNumber) and add 0 OnprintCountOverflow => => IncrementPrintCount 1 (FirstNumber) And, What's that? We're done? Press the button and now they should increase when you click! But let's look at some other ways to do it. Using a relay "Pressing a button is so tiring and tedious!" You angrily email to me, Well let's use a relay then so little baby doesn't break his wrist. Head over to the button and remove the line we had before, Now let's change the lines to 0 OnActivate => Self => fireRelay 1 500 OnRelay => Self => fireRelay 2 onRelay => => IncrementPrintCount 1 (SecondNumber) *The second number is a delay. You don't want it to fire too often. See what we did there? It's the same as before only now the brick will keep pressing (Relaying) it for you, So you can go out and kiss ladies. Or men, or something. But hey, We're using a relay already, So why not use more and get rid of a named brick in the process? Making FirstNumber lose his name without getting the FBI involved (Relays continued) Hit SecondNumber with the wrench (He deserves it) and remove the event in it. The button is already sending a relay to SecondNumber that's increasing it, Now we're going to send a message to FirstNumber without it being named. Which i'm sure you'll be glad to hear includes more relays. 0 onPrintCountOverflow => Self => FireRelayEast But HOLD ON. You'll want to replace "FireRelayEast" with the direction that FirstNumber is sitting. The best way to find the direction is to make a laser emitter and point it north. Now that we're sending it magically to FirstNumber we need FirstNumber to use that relay it's being sent. So for the final time tonight, Let's select FirstNumber and remove his events, Now the magic happens (No actual magic happens.) Add the following event 0 OnRelay => Self => IncrementPrintCount 1 And that's it. Now he's using the relay sent to him and it should all be set up and completely working! But let's just go over it one more time, I know what you're like. First we send a relay from the button to the SecondNumber, Then once the SecondNumber overflows we send a relay towards the button that tells it to increase too. And hey, If it does, Maybe you could make some kind of machine that predicts the returning of jesus. I dare you. Drheadcrab 22:50, April 26, 2012 (UTC) Category:Eventing Category:Tutorials